# eval()
print(eval('123+1'))
print(eval('123'))
print(eval('2*3'))
print(eval('2%3'))
print(eval('6/3'))
print(eval('6//3'))


s = 'holle world! holle python'
#len() 返回字符串的长度
print(len(s))

#upper()
s = s.upper()
print(s)
#lower()
print(s.lower())
#capitalize()
s = s.capitalize()
print(s)
#swapcase()
print(s.swapcase())
#title()

print(s.title())

#count()
print(s.count('l'))

#find()
print(s.find('l'))
print(s.find('W'))

#rfind()
print(s.find('l'))

#index()
print(s.index('l'))
# print(s.index('W'))
#rindex()
print(s.rindex('l'))

#split()  m默认以空格为分隔符,返回list
s_list = s.split(' ')
print(s_list)
#join()
print(' '.join(s_list))
#splitlines()
ss = s.replace(' ','\n')
print(ss)
print(ss.splitlines())
#strip()  删除顺序从外里，没有就停止
sss = '*..*' + s + '*..@*'
print(sss)
# print(sss.strip('*'))
# print(sss.strip('*'))
# print(sss.strip('*@'))
print(sss.strip('*@.'))
#rstrip()
print(sss)
print(sss.rstrip('*@.'))
#lstrip()
print(sss)
print(sss.lstrip('*@.'))

#max() min()
print(max(s))
#min()
print(min(s))

#chr()
print(chr(97))
#ord()
print(ord('A'))

#decode() 编码
print(s.encode('utf-8'))
print(s.encode('gbk'))
#decode 解码
print(b'Holle world! holle python'.decode('utf-8'))
print(b'Holle world! holle python'.decode('gbk'))

#isalpha()
print(s.isalpha())
print(s.isdigit())
print(s.isdecimal())
print(s.isspace())
print(s.islower())
print(s.isupper())
print(s.isalnum())